package com.rkc.config;

import com.rkc.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author `RKC`
 * @date 2021/10/22 14:46
 */
@Configuration
public class WebMvcConfiguration implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/api/coupon/*/**", "/api/coupon_record/*/**")
                .excludePathPatterns("/api/coupon/*/page_coupon", "/api/coupon/*/new_user_coupon");
    }
}
